package com.wetao.lib_common.greendao.model;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.NotNull;
import org.greenrobot.greendao.annotation.ToMany;

import java.util.List;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.DaoException;
import org.greenrobot.greendao.annotation.Unique;

import com.wetao.lib_common.greendao.dao.DaoSession;
import com.wetao.lib_common.greendao.dao.PagePictureGridDao;
import com.wetao.lib_common.greendao.dao.PagePictureDao;

@Entity
public class PagePicture {
    public void setGridList(List<PagePictureGrid> gridList) {
        this.gridList = gridList;
    }
    public Long getId() {
        return this.id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getPictureUrl() {
        return this.pictureUrl;
    }
    public void setPictureUrl(String pictureUrl) {
        this.pictureUrl = pictureUrl;
    }
    public Integer getBigPicWidth() {
        return this.bigPicWidth;
    }
    public void setBigPicWidth(Integer bigPicWidth) {
        this.bigPicWidth = bigPicWidth;
    }
    public Integer getBigPicHeight() {
        return this.bigPicHeight;
    }
    public void setBigPicHeight(Integer bigPicHeight) {
        this.bigPicHeight = bigPicHeight;
    }
    public Integer getPictureId() {
        return this.pictureId;
    }
    public void setPictureId(Integer pictureId) {
        this.pictureId = pictureId;
    }
    public Integer getBookId() {
        return this.bookId;
    }
    public void setBookId(Integer bookId) {
        this.bookId = bookId;
    }
    public Integer getPageNumber() {
        return this.pageNumber;
    }
    public void setPageNumber(Integer pageNumber) {
        this.pageNumber = pageNumber;
    }
    public Integer getSectionNo() {
        return this.sectionNo;
    }
    public void setSectionNo(Integer sectionNo) {
        this.sectionNo = sectionNo;
    }
    public Integer getOwnerNo() {
        return this.ownerNo;
    }
    public void setOwnerNo(Integer ownerNo) {
        this.ownerNo = ownerNo;
    }
    public String getPageserial() {
        return this.pageserial;
    }
    public void setPageserial(String pageserial) {
        this.pageserial = pageserial;
    }
    public boolean getIsMore() {
        return this.isMore;
    }
    public void setIsMore(boolean isMore) {
        this.isMore = isMore;
    }
    public boolean getIsHttp() {
        return this.isHttp;
    }
    public void setIsHttp(boolean isHttp) {
        this.isHttp = isHttp;
    }
    public Float getStartX_L() {
        return this.startX_L;
    }
    public void setStartX_L(Float startX_L) {
        this.startX_L = startX_L;
    }
    public Float getStartY_L() {
        return this.startY_L;
    }
    public void setStartY_L(Float startY_L) {
        this.startY_L = startY_L;
    }
    public Float getEndX_L() {
        return this.endX_L;
    }
    public void setEndX_L(Float endX_L) {
        this.endX_L = endX_L;
    }
    public Float getEndY_L() {
        return this.endY_L;
    }
    public void setEndY_L(Float endY_L) {
        this.endY_L = endY_L;
    }
    public Float getStartX_R() {
        return this.startX_R;
    }
    public void setStartX_R(Float startX_R) {
        this.startX_R = startX_R;
    }
    public Float getStartY_R() {
        return this.startY_R;
    }
    public void setStartY_R(Float startY_R) {
        this.startY_R = startY_R;
    }
    public Float getEndX_R() {
        return this.endX_R;
    }
    public void setEndX_R(Float endX_R) {
        this.endX_R = endX_R;
    }
    public Float getEndY_R() {
        return this.endY_R;
    }
    public void setEndY_R(Float endY_R) {
        this.endY_R = endY_R;
    }
    public String getOssUrl() {
        return this.ossUrl;
    }
    public void setOssUrl(String ossUrl) {
        this.ossUrl = ossUrl;
    }
    public Integer getScale() {
        return this.scale;
    }
    public void setScale(Integer scale) {
        this.scale = scale;
    }
    public Long getAssistantExamId() {
        return this.assistantExamId;
    }
    public void setAssistantExamId(Long assistantExamId) {
        this.assistantExamId = assistantExamId;
    }
    /**
     * To-many relationship, resolved on first access (and after reset).
     * Changes to to-many relations are not persisted, make changes to the target entity.
     */
    @Generated(hash = 1472252824)
    public List<PagePictureGrid> getGridList() {
        if (gridList == null) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            PagePictureGridDao targetDao = daoSession.getPagePictureGridDao();
            List<PagePictureGrid> gridListNew = targetDao
                    ._queryPagePicture_GridList(id);
            synchronized (this) {
                if (gridList == null) {
                    gridList = gridListNew;
                }
            }
        }
        return gridList;
    }
    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    @Generated(hash = 2147392955)
    public synchronized void resetGridList() {
        gridList = null;
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }
    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 612221527)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getPagePictureDao() : null;
    }

    @Id(autoincrement = true)
    private Long id;

    //图片地址
    private String pictureUrl;
    //大图宽度
    private Integer bigPicWidth;
    //大图高度
    private Integer bigPicHeight;
    //
    @NotNull
    @Unique
    private Integer pictureId;
    //铺码id
    private Integer bookId;
    //页码
    private Integer pageNumber;
    //
    private Integer sectionNo;
    //
    private Integer ownerNo;
    //云蝶的序列号
    private String pageserial;

    //下面这些参数要自己计算
    private boolean isMore; //这一张图片是否只有一个章节
    private boolean isHttp; //这一页图片是否点击过，如果没有点击过，下次点击还是需要从后台请求一下数据（防止一页两个课时）
    private Float startX_L; //如果一张图片有两个章节，需要计算坐标区分
    private Float startY_L;
    private Float endX_L;
    private Float endY_L;
    private Float startX_R; //如果一张图片有两个章节，需要计算坐标区分, 有的区分左右两列
    private Float startY_R;
    private Float endX_R;
    private Float endY_R;
    private String ossUrl; //自己管理
    private Integer scale; //自己管理，图片放大倍数


    @NotNull
    private Long assistantExamId;
    @ToMany(referencedJoinProperty = "pagePictureId")
    private List<PagePictureGrid> gridList;

    /** Used to resolve relations */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;

    /** Used for active entity operations. */
    @Generated(hash = 2074667407)
    private transient PagePictureDao myDao;
    @Generated(hash = 116114566)
    public PagePicture(Long id, String pictureUrl, Integer bigPicWidth,
            Integer bigPicHeight, @NotNull Integer pictureId, Integer bookId,
            Integer pageNumber, Integer sectionNo, Integer ownerNo,
            String pageserial, boolean isMore, boolean isHttp, Float startX_L,
            Float startY_L, Float endX_L, Float endY_L, Float startX_R,
            Float startY_R, Float endX_R, Float endY_R, String ossUrl,
            Integer scale, @NotNull Long assistantExamId) {
        this.id = id;
        this.pictureUrl = pictureUrl;
        this.bigPicWidth = bigPicWidth;
        this.bigPicHeight = bigPicHeight;
        this.pictureId = pictureId;
        this.bookId = bookId;
        this.pageNumber = pageNumber;
        this.sectionNo = sectionNo;
        this.ownerNo = ownerNo;
        this.pageserial = pageserial;
        this.isMore = isMore;
        this.isHttp = isHttp;
        this.startX_L = startX_L;
        this.startY_L = startY_L;
        this.endX_L = endX_L;
        this.endY_L = endY_L;
        this.startX_R = startX_R;
        this.startY_R = startY_R;
        this.endX_R = endX_R;
        this.endY_R = endY_R;
        this.ossUrl = ossUrl;
        this.scale = scale;
        this.assistantExamId = assistantExamId;
    }
    @Generated(hash = 648935769)
    public PagePicture() {
    }


}
